<?php
declare (strict_types = 1);
namespace app\common\model\payment;

use app\common\model\BaseModel;
use app\course\model\coupon\Coupon;

/**
 * 订单模型
 */
class PaymentOrderCoupon extends BaseModel
{
    /**
     * 表名
     * @var string
     */
    protected $name = 'payment_order_item_coupon';

    /**
     * 设置自动写入时间
     * @var boolean
     */
    protected $autoWriteTimestamp = true;
    protected $updateTime = false;
    // protected $hidden = ['delete_time'];

    /**
     * 定义字段类型
     * @var array
     */
    protected $type = [
        'id'            => 'integer',
        'create_time'   => 'integer',
    ];

    public function user()
    {
        return $this->belongsTo(Coupon::class, 'coupon_id');
    }

}
 